<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
</body>
<script>
    //找出数组中的最大值和平均数
    let score=[56,78,96,86,53,62,77,24,18];
    let max=0;
    for(let i=0;i<=score.length;i++){
       if(max<score[i]){
        max=score[i];
       } 
    }
    console.log('最大值:'+max);
    let he=0;
    let pjs;
    for(let n=0;n<score.length;n++){
        he+=score[n];  //he+=score[n]等于he=he+score[n]
    }
    console.log('总值:'+he);
    pjs=he/score.length;
    console.log('平均数:'+pjs);
    score[220]=55;
    console.log(score[220]);
    console.log(score.length);
</script>
</html>